//
//  PPAbstractTimelineViewController.h
//  pickpic
//
//  Created by Jinxiao on 8/27/16.
//  Copyright © 2016 MicroDream. All rights reserved.
//

#import "PPAbstractViewController.h"

#import "DGScrollViewWrapper.h"

@interface PPAbstractTimelineViewController : PPAbstractViewController <UITableViewDelegate, UITableViewDataSource>

@property (readonly) NSArray *items;

@property (readonly) UITableView *tableView;

@property (readonly) DGScrollViewWrapper *scrollWrapper;

- (void)fetchNewItems;
- (void)fetchMoreItems;

- (NSArray *)initialItems;
- (void)cacheItems:(NSArray *)items;
- (void)clearItems;

- (void)removeItem:(id)item;
- (void)removeAllItems;

- (NSArray *)didReceiveNewResult:(id)result;
- (NSArray *)didReceiveMoreResult:(id)result;

- (void)processNewItems:(NSArray *)newItems;
- (void)processMoreItems:(NSArray *)moreItems;

- (NSArray *)itemsFromResult:(id)result;

- (UITableViewStyle)preferredTableViewStyle;

- (UIEdgeInsets)preferredScrollInsets;

- (UIView *)emptyPromptViewForError:(NSError *)error;
- (CGPoint)preferredEmptyPromptViewCenter;

- (void)reloadDataSource;

- (BOOL)prefersRefreshAutomatically;

@property (readwrite, nonatomic, assign) BOOL manuallyCache;

@end
